<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
<%
request.setCharacterEncoding("utf-8");
response.setCharacterEncoding("utf-8");
response.setContentType("text/html;charset=utf-8");

%>
<%@ include file="common/head.jsp"%>

<body class="fix-header fix-sidebar">
	<!-- Preloader - style you can find in spinners.css -->
	<div class="preloader">
		<svg class="circular" viewBox="25 25 50 50">
				<circle class="path" cx="50" cy="50" r="20" fill="none"
				stroke-width="2" stroke-miterlimit="10" /> </svg>
	</div>
	<!-- Main wrapper  -->
	<div id="main-wrapper">
		<!-- header header  -->
		<%@ include file="common/header.jsp"%>
		<!-- End header header -->
		<!-- Left Sidebar  -->
		<%@ include file="common/nav.jsp"%>
		<!-- End Left Sidebar  -->
		<!-- Page wrapper  -->
		<div class="page-wrapper">
			<!-- 锐高软件 -->
			 <%@ include file="../common/ruigao.jsp" %>
			
			<div class="container-fluid">
				<!-- Start Page Content -->
				<div class="row justify-content-center">
					<div class="col-lg-12">
						<div class="card">
							<div class="card-body">
								<div class="card-content">
									<!-- Left sidebar -->
									<div class="inbox-leftbar">

										<a href="${pageContext.request.contextPath}/company_list.jsp"
											class="btn btn-danger btn-block waves-effect waves-light">
											<font style="vertical-align: inherit;"> <font
												style="vertical-align: inherit;">公司查看</font>
										</font>
										</a>
									</div>
									<!-- End Left sidebar -->
									<div class="inbox-rightbar">
										<div class="" role="toolbar">
											<div class="btn-group">
												<button type="button" class="btn btn-light waves-effect">
													<i class="mdi mdi-archive font-18 vertical-middle"></i>
												</button>
												<button type="button" class="btn btn-light waves-effect">
													<i class="mdi mdi-alert-octagon font-18 vertical-middle"></i>
												</button>
												<button type="button" class="btn btn-light waves-effect">
													<i class="mdi mdi-delete-variant font-18 vertical-middle"></i>
												</button>
											</div>

											

										</div>
									</div>
								</div>
							</div>
							<div class="form-validation">
								<form class="form-valide col-lg-8" id="form" method="post"
									novalidate="novalidate" style="margin: 0 auto;">
									<div class="form-group row">
										<label class="col-lg-2 col-form-label" for="val-name">公司名称</label>
										<div class="col-lg-10">
											<input type="text" class="form-control" id="val-name"
												name="val-name" placeholder="输入公司名称" required="required" >
										</div>
									</div>
									<div class="form-group row">
										<label class="col-lg-2 col-form-label" for="val-username">创始人</label>
										<div class="col-lg-10">
											<input type="text" class="form-control" id="val-username"
												name="val-username" placeholder="输入创始人姓名" required="required" >
										</div>
									</div>
									<div class="form-group row">
										<label class="col-lg-2 col-form-label" for="val-number">创办时间</label>
										<div class="col-lg-10">
											<input type="date" class="form-control" placeholder="dd/mm/yyyy" name="val-date" required="required" >
										</div>
									</div>

									
									<div class="form-group row">
										<label class="col-lg-2 col-form-label" for="val-skill">公司性质</label>
										<div class="col-lg-10">
											<select class="form-control" id="val-skill" name="val-skill">
												<option value="国有企业">国有企业</option>
												<option value="集体企业">集体企业</option>
												<option value="联营企业">联营企业</option>
												<option value="私营企业">私营企业</option>
												<option value="个体户">个体户</option>
												<option value="合伙企业">合伙企业</option>
												<option value="有限责任企业">有限责任企业</option>
												<option value="股份有限企业">股份有限企业</option>
											</select>
										</div>
									</div>

									<div class="form-group row">
										<label class="col-lg-2 col-form-label" for="val-skill">公司规模</label>
										<div class="col-lg-10">
											<textarea name="val-scope" id="val-skill" rows="2" cols="60"
												class="form-control" style="height: 100px;"></textarea>
										</div>
									</div>

									<div class="form-group row">
										<label class="col-lg-2 col-form-label" for="val-skill">公司背景</label>
										<div class="col-lg-10">
											<textarea name="val-background" id="val-skill" rows="2" cols="60"
												class="form-control" style="height: 100px;"></textarea>
										</div>
									</div>
									<div class="form-group row">
										<label class="col-lg-2 col-form-label" for="val-skill">企业文化</label>
										<div class="col-lg-10">
											<textarea name="val-culture" id="val-skill" rows="2" cols="60"
												class="form-control" style="height: 100px;"></textarea>
										</div>
									</div>

									<div class="form-group row">
										<label class="col-lg-2 col-form-label" for="val-skill">业务范围</label>
										<div class="col-lg-10">
											<textarea name="val-range" id="val-skill" rows="2" cols="60"
												class="form-control" style="height: 100px;"></textarea>
										</div>
									</div>
									<div class="form-group row">
										<label class="col-lg-2 col-form-label" for="val-skill">规章制度</label>
										<div class="col-lg-10">
											<textarea name="val-rule" id="val-skill"  rows="2"
												cols="60" class="form-control" style="height: 100px;"></textarea>
										</div>
									</div>
									<div class="form-group row">
										<div class="col-lg-8 ml-auto">
											<button type="button" id = "but" class="btn btn-success btn sweet-tijiao ">创办</button>
											<input type="hidden" name="selectcompan" value="" id="selectcompan">
											<button type="reset" class="btn btn-primary ">重置</button>
										</div>
									</div>
								</form>
							</div>
						</div>
					</div>
				</div>
			</div>

		</div>

	</div>
	<!-- footer -->
	<%@ include file="common/footer.jsp"%>
	<!-- End footer -->
	<%@ include file="common/js.jsp"%>
	<script type="text/javascript">
	$(function(){
	 $("#but").click(function(){
		
		$("#selectcompan").val("companyadd");
		$.ajax({
			url:"selectcompany",
			type:"POST",
			data:$("#form").serialize(),
			datatype:"json",
			success:function(data){
					if(data){
						  swal(
								{
										title : "创办成功!",
										type:'success',
										 text: "是否返回列表查看？", 
										showCancelButton : true,
										closeOnConfirm : false,
										cancelButtonText : "取消",
										confirmButtonText : "确定"
									},
									function(inputValue) {
										if (inputValue == true){
									     location.href="${pageContext.request.contextPath}/company_list.jsp";
										}else{
											return false;
										}
									});						 			 			
				        }
			},error:function(data){
				 swal({
			            title:'创办失败！',		           
			            type:'error',
			            confirmButtonText:'确定',
			            closeOnConfirm:false
			         });
			}
			
		});
	 });
	});
	</script> 
</body>

</html>